/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gameheart.client.sprite;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

/**
 *
 * @author win7
 */
public class LabelSprite extends Sprite {

    public String _text;
    public Color _color;
    
    public LabelSprite(int x, int y, String text, BufferedImage _bg, Color color) {
        _text = text;
        _color = color;
        Init(x, y, _bg);
    }

    public LabelSprite(int x, int y, String text, BufferedImage _bg) {
        _text = text;
        _color = Color.black;
        Init(x, y, _bg);
    }

    public LabelSprite(int x, int y, int w, int h, String text, BufferedImage _bg) {
        _text = text;
        _color = Color.black;
        Init(x, y, w, h, _bg);
    }

    @Override
    public void draw(Graphics g) {
        super.draw(g);
        Color color = g.getColor();
        g.setColor(_color);
        g.drawString(_text, _x + 20, _y + 20);
        g.setColor(color);
    }
}
